const colorList = ['#287CE8', '#E79145', '#41E4DE', '#FFC24D', '#32B8F0'];

// 关系图
export const getOptions = (nodes: Array<{ name: string } & { [key: string]: any }>, links: Array<{ source: string; target: string }> = [], top = '1%', bottom = '1%') => {
  const names: Array<{ [key: string]: any }> = [
    {
      name: '四川省三益康养服务有限公司',
      itemStyle: {
        color: colorList[0],
      },
    },
    { name: '风险疑点' },
  ];

  return {
    color: colorList,
    animation: false,
    series: {
      type: 'sankey',
      layout: 'none',
      draggable: false,
      left: '4%',
      top,
      right: '4%',
      bottom,
      nodeAlign: 'justify',
      lineStyle: {
        color: '#888888', // 这里设置所有连线的颜色为 #123456
      },
      emphasis: {
        focus: 'adjacency',
        label: {
          overflow: 'none',
        },
      },
      data: nodes,
      orient: 'vertical',
      label: {
        position: 'top',
        fontSize: 20,
        color: '#ffffff',
        borderWidth: 0,
        width: 120,
        overflow: 'truncate',
        ellipsis: '...',
      },
      links: links,
      //   [
      //     // { source: "风险疑点.", target: "四川省三益康养服务有限公司", value: 5 },
      //     ...data.map((d) => {
      //       return {
      //         ...d,
      //         value: 1,
      //       };
      //     }),
      //   ],
    },
  };
};
